#ifndef MYOPENGLWIDGET_H
#define MYOPENGLWIDGET_H

#include <QOpenGLWidget>
#include <QOpenGLFunctions_3_3_Core>
#include <QOpenGLShaderProgram>
#include <QOpenGLTexture>

#include "vao.h"

class MyOpenGLWidget : public QOpenGLWidget, QOpenGLFunctions_3_3_Core
{
    Q_OBJECT
public:
    explicit MyOpenGLWidget(QWidget* parent = nullptr);
    ~MyOpenGLWidget();
    void changeDraw();
    void changeLine();

protected:
    void initializeGL() override;
    void resizeGL(int w, int h) override;
    void paintGL() override;
    void bind_vao();
    void unbind_vao();

signals:

public slots:

private:
    VAO *vao = nullptr;

    QOpenGLShaderProgram shaderProgram;
    QOpenGLTexture *tLand;
    QOpenGLTexture *tGrass;
    QOpenGLTexture *tNoise;

    bool isDraw = false;
    bool isLine = false;

};

#endif // MYOPENGLWIDGET_H
